package Common;

public class ImageValidator{ 
   /**
   * Validate image with regular expression
   * @param image image for validation
   * @return true valid image, false invalid image
   */
   public static boolean validate(final String image){
	   int pos = image.lastIndexOf('.');
	   String ext = image.substring(pos+1);
	   
	   return ext.toLowerCase().equals("gif") || ext.toLowerCase().equals("jpg") || 
			   ext.toLowerCase().equals("png") || ext.toLowerCase().equals("bmp");
 
   }
}
